package com.menggudf.entity;

import java.io.Serializable;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Entity
@Table(name="medicalDB")
public class MedicalDB implements Serializable{

    /**
     * 
     */
    private static final long serialVersionUID = 246063680277139624L;

    private int id;
    private String name;
    private String details;
    private Date createdTime;
    private Integer skinTest;
    private String medicineUsage;
    private String frequency;
    private String sideEffect;
    /*private String taboo;*/
    
    private String type;
/*    private double dose;
    private double maxDose;
    private double minDose;*/
    
    private double dose;
/*    private double childDose; 
    private double childMaxDose;
    private double childMinDose; 
    private double manDose; 
    private double manMaxDose; 
    private double manMinDose;*/
    
    private String unit;
    
/*    private int isChild;*/
    
    private String total;
    
    private Set<MedicalDBDetail> medicalDBDetails = new HashSet<MedicalDBDetail>(0);
    private Set<MedicalTaboo> medicalTaboos = new HashSet<MedicalTaboo>(0);
    
    @Id
    @Column(name="id",unique=true,nullable=false)
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    public int getId() {
        return id;
    }
    public void setId(int id) {
        this.id = id;
    }
    
    @Column(name="name")
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    
    @Column(name="details")
    public String getDetails() {
        return details;
    }
    public void setDetails(String details) {
        this.details = details;
    }
    
    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "createdTime", length = 19)
    public Date getCreatedTime() {
        return createdTime;
    }
    public void setCreatedTime(Date createdTime) {
        this.createdTime = createdTime;
    }
    
    @Column(name = "skinTest")
    public Integer getSkinTest() {
        return skinTest;
    }
    public void setSkinTest(Integer skinTest) {
        this.skinTest = skinTest;
    }
    
    public String getMedicineUsage() {
        return medicineUsage;
    }
    public void setMedicineUsage(String medicineUsage) {
        this.medicineUsage = medicineUsage;
    }
    @Column(name = "sideEffect")
    public String getSideEffect() {
        return sideEffect;
    }
    public void setSideEffect(String sideEffect) {
        this.sideEffect = sideEffect;
    }
    
/*    @Column(name = "taboo")
    public String getTaboo() {
        return taboo;
    }
    public void setTaboo(String taboo) {
        this.taboo = taboo;
    }*/
    
    @Column(name = "type")
    public String getType() {
        return type;
    }
    public void setType(String type) {
        this.type = type;
    }
    
    @Column(name = "dose")
    public double getDose() {
        return dose;
    }
    public void setDose(double dose) {
        this.dose = dose;
    }
    
    @Column(name = "unit")
    public String getUnit() {
        return unit;
    }
    public void setUnit(String unit) {
        this.unit = unit;
    }
    
    @Column(name = "total")
    public String getTotal() {
        return total;
    }
    public void setTotal(String total) {
        this.total = total;
    }
    
    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = "medicalDB")
    public Set<MedicalDBDetail> getMedicalDBDetails() {
        return medicalDBDetails;
    }
    public void setMedicalDBDetails(Set<MedicalDBDetail> medicalDBDetails) {
        this.medicalDBDetails = medicalDBDetails;
    }
    
    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = "medicalDB")
    public Set<MedicalTaboo> getMedicalTaboos() {
        return medicalTaboos;
    }
    public void setMedicalTaboos(Set<MedicalTaboo> medicalTaboos) {
        this.medicalTaboos = medicalTaboos;
    }
    
    @Column(name = "frequency")
    public String getFrequency() {
        return frequency;
    }
    public void setFrequency(String frequency) {
        this.frequency = frequency;
    }
    
    
}
